function HandleBCouriers(gui, user, date, options, data) {
  this._gui = gui;
  this._user = user;
  this._date = date;
  this._options = options;
  this._data = data;
  
  this._popupBox = new ModulePopupBox();
  
  this._createElements();
};

HandleBCouriers.prototype._createElements = function() {
  var tr, td, _self = this;
  DOMUtils.removeTableRows(this._gui.couriers, 1);
  this._gui.add.onclick = function() { location.href = '?t=bcourier';
                                     };

  if (this._data[0].data.length == 0) {
    tr = this._gui.couriers.insertRow(-1);
    td = tr.insertCell(-1);
    td.colSpan = 2;
    td.style.height = '23px';
    td.style.textAlign = 'left';
    td.style.paddingLeft = '5px';
    td.appendChild(document.createTextNode('n/a'));
  }

  MiscUtils.sort(this._data[0].data, ['name']);
  for(var i = 0, il = this._data[0].data.length; i < il; i++) {
    var c = this._data[0].data[i];
    tr = this._gui.couriers.insertRow(-1);
    tr.style.backgroundColor = (tr.rowIndex % 2 == 0) ? '#ececec' : '#fff';
    td = tr.insertCell(-1);
    td.style.height = '23px';
    td.style.textAlign = 'left';
    td.style.padding = '0 5px';
    var a = document.createElement('a');
    a.href = '#';
    a.appendChild(document.createTextNode(c.name));
    a._c = c;
    a.onclick = function() { location.href = '?t=bcourier&i=' + this._c.id;
                           };
    td.appendChild(a);

    td = tr.insertCell(-1);
    td.style.height = '23px';
    td.style.textAlign = 'center';
    td.style.padding = '0 5px';
    var remove = document.createElement('img');
    remove.src = 'image/delete.png';
    remove.style.cursor = 'pointer';
    remove._c = c;
    remove.onclick = function() { new RequestUtils()._write('pz_courier', [], [this._c], function() { location.reload(); }, {pos: DOMUtils.findPos(this)}); };
    td.appendChild(remove);
  }
};
